package com.pb.wkflow.api.config;

import lombok.Getter;

/**
 * TransNodeNameEnum
 * @author 苗益辉
 * @date 2022/11/21 14:22
 */
public enum TransNodeNameEnum {

    /**
     * REGISTER
     */
    REGISTER("noneEndEvent", "审批通过");

    /**
     * nodeId
     */
    private String nodeId;

    /**
     * nodeName
     */
    @Getter
    private String nodeName;

    /**
     * TransNodeNameEnum
     * @param nodeId nodeId
     * @param nodeName nodeName
     */
    TransNodeNameEnum(String nodeId, String nodeName) {
        this.nodeId = nodeId;
        this.nodeName = nodeName;
    }

    public static TransNodeNameEnum getEnum(String nodeId) {
        for (TransNodeNameEnum transNodeNameEnum : TransNodeNameEnum.values()) {
            if (transNodeNameEnum.nodeId.equals(nodeId)) {
                return transNodeNameEnum;
            }
        }
        return null;
    }
}
